package com.edu.test;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 *  spring管理的bean 如何获取 beanId 和 容器
 */
public class MyTest04 {

    ClassPathXmlApplicationContext context ;

    @Before
    public void init(){

        context = new ClassPathXmlApplicationContext("spring-ioc3.xml");

    }

    @Test
    public void test01(){
        System.out.println(context.getBean("dataSource"));
    }
}
